package Ar;

import java.util.Scanner;

/**
 * @Author MDD
 * @Description
 * @Version
 * @Date
 **/
public class TwoDimensions {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] totals = new int[3];
        //int total;
        int [][] score = new int[3][4];//分配的空间一样的话之间写长度，不一样不写长度
        for (int i = 0; i < score.length; i++) {
            System.out.println("第"+(i+1)+"班");
            //total = 0;
            for (int j = 0; j < score[i].length; j++) {
                System.out.print("\t第"+(j+1)+"名学生的成绩：");
                score[i][j] = sc.nextInt();
                //total += score[i][j];
                totals[i] += score[i][j];
            }
        }
        System.out.println("==========成绩统计==============");
        for (int i = 0; i < totals.length; i++) {
            System.out.println("第"+(i+1)+"班的总成绩："+totals[i]);
        }
    }
}
